import React, { Component } from "react";
import { Text, View, StyleSheet } from "react-native";

const DashSecondLine = props => {
  const { len, width, backgroundColor } = props;
  const arr = [];
  for (let i = 0; i < len; i += 1) {
    arr.push(i);
  }
  return (
    <View style={[styles.dashLine, { width }]}>
      {arr.map((item, index) => {
        return (
          <Text style={[styles.dashItem, { backgroundColor }]} key={String(index)}>
            {" "}
          </Text>
        );
      })}
    </View>
  );
};

const styles = StyleSheet.create({
  dashLine: {
    flexDirection: "row",
  },
  dashItem: {
    height: 1,
    width: 2,
    marginRight: 2,
    flex: 1,
  },
});

export default DashSecondLine;
